package org.whatever.aha.zjut.platform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.whatever.aha.zjut.platform.entity.UserRole;

import java.util.List;

/**
 * @author Vc
 * @version 1.0
 * @date 2021/8/8 10:55 下午
 */
public interface UserRoleMapper extends BaseMapper<UserRole> {

    @Insert("insert into user_role(role_id, user_id) value(1, #{userId})")
    void addStudentRole(@Param("userId") int userId);

    @Select("select role_id from user_role where user_id = #{userId}")
    Integer getRoleByUid(@Param("userId") int userId);
}
